package 实验三;

public class Student extends Person {

    private Course selectedCourse;

    public Student(String id, String name, String gender, Course selectedCourse) {
        super(id, name, gender);
        this.selectedCourse = selectedCourse;
    }

    // 子类业务方法：打印课表（重写/扩展父类逻辑）
    public void printSchedule() {
        super.printBasicInfo();
        System.out.println("所选课程：" + selectedCourse.getName() + "（地点：" + selectedCourse.getLocation() + "，时间：" + selectedCourse.getTime() + "，授课教师：" + selectedCourse.getTeacher().getName() + "）");
    }

 
    public Course getSelectedCourse() {
        return selectedCourse;
    }
}
